package com.xiangshizhineng.tianzhangzhi.app.model.request;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xiangshizhineng.tianzhangzhi.app.common.base.BaseDTO;
import com.xiangshizhineng.tianzhangzhi.app.utils.LongJsonSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel("轨迹信息")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tz_trajectory")
public class TrajectoryRequest extends BaseDTO implements Serializable {
    /**
     * 任务id
     */
    @ApiModelProperty(value = "任务id")
//    @JsonSerialize(using = LongJsonSerializer.class)
    private Long taskId;

    /**
     * 距离
     */
    @ApiModelProperty(value = "距离")
    private Float distance;

    /**
     * X坐标
     */
    @ApiModelProperty(value = "X坐标")
    @NotNull(message = "x坐标为空")
    private BigDecimal x;

    /**
     * Y坐标
     */
    @ApiModelProperty(value = "Y坐标")
    @NotNull(message = "y坐标值为空")
    private BigDecimal y;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @JsonSerialize(using = LongJsonSerializer.class)
    private Long userId;

    /**
     * 记录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "记录时间")
    @NotNull(message = "记录时间为空")
    private Date recordtime;

    /**
     *
     */
    @ApiModelProperty(value = "")
    private Date createTime;
    /**
     *
     */
    @ApiModelProperty(value = "")
    private Date updateTime;
}
